home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / ietf / urn / urn-archives / urn-ietf.archive.9611 / 000188_owner-urn-ietf _Wed Nov 20 15:32:15 1996.msg < prev    next >
Internet Message Format  |  1997-02-19  |  18KB

  1. Received: (from daemon@localhost) by services.bunyip.com (8.6.10/8.6.9) id PAA08321 for urn-ietf-out; Wed, 20 Nov 1996 15:32:15 -0500
  2. Received: from mocha.bunyip.com (mocha.Bunyip.Com [192.197.208.1]) by services.bunyip.com (8.6.10/8.6.9) with SMTP id PAA08316 for <urn-ietf@services.bunyip.com>; Wed, 20 Nov 1996 15:32:10 -0500
  3. Received: from acl.lanl.gov by mocha.bunyip.com with SMTP (5.65a/IDA-1.4.2b/CC-Guru-2b)
  4.         id AA08307  (mail destined for urn-ietf@services.bunyip.com); Wed, 20 Nov 96 15:32:01 -0500
  5. Received: from magenta.acl.lanl.gov (rdaniel@magenta.acl.lanl.gov [128.165.147.153]) by acl.lanl.gov (8.7.3/8.7.3) with ESMTP id NAA29850 for <urn-ietf@bunyip.com>; Wed, 20 Nov 1996 13:31:58 -0700 (MST)
  6. From: "Ronald E. Daniel" <rdaniel@acl.lanl.gov>
  7. Received: (rdaniel@localhost) by magenta.acl.lanl.gov (8.7.5/8.6.4) id NAA29358 for urn-ietf@bunyip.com; Wed, 20 Nov 1996 13:31:57 -0700 (MST)
  8. Date: Wed, 20 Nov 1996 13:31:57 -0700 (MST)
  9. Message-Id: <199611202031.NAA29358@magenta.acl.lanl.gov>
  10. To: urn-ietf@bunyip.com
  11. Subject: [URN] HTTP conventions draft
  12. Sender: owner-urn-ietf@services.bunyip.com
  13. Precedence: bulk
  14. Reply-To: "Ronald E. Daniel" <rdaniel@acl.lanl.gov>
  15. Errors-To: owner-urn-ietf@bunyip.com
  16.  
  17. Hi,
  18.  
  19. I've changed the conventions draft to remove the integer from the
  20. text/uri-list media type. The new version is appended. I will
  21. send this to the ID editor later today.
  22.  
  23. Regards,
  24. Ron
  25. ====
  26. INTERNET DRAFT                                                  Ron Daniel
  27. draft-ietf-urn-http-conventions-00.txt      Los Alamos National Laboratory
  28.                                                               13 Nov, 1996
  29.  
  30.  
  31.          Conventions for the Use of HTTP for URN Resolution
  32.  
  33.  
  34. Status of this Memo
  35. ===================
  36.  
  37.     This document is an Internet-Draft.  Internet-Drafts are working
  38.     documents of the Internet Engineering Task Force (IETF), its
  39.     areas, and its working groups.  Note that other groups may also
  40.     distribute working documents as Internet-Drafts.
  41.   
  42.     Internet-Drafts are draft documents valid for a maximum of six
  43.     months and may be updated, replaced, or obsoleted by other
  44.     documents at any time.  It is inappropriate to use Internet-
  45.     Drafts as reference material or to cite them other than as
  46.     ``work in progress.''
  47.   
  48.     To learn the current status of any Internet-Draft, please check
  49.     the ``1id-abstracts.txt'' listing contained in the Internet-
  50.     Drafts Shadow Directories on ftp.is.co.za (Africa),
  51.     nic.nordu.net (Europe), munnari.oz.au (Pacific Rim),
  52.     ds.internic.net (US East Coast), or ftp.isi.edu (US West Coast).
  53.  
  54.     This draft expires 15 May, 1997.
  55.   
  56.   
  57.  
  58. Abstract:
  59. =========
  60.  
  61. The URN-WG was formed to specify persistent, location-independent names
  62. for network accessible resources, and resolution mechanisms to retrive
  63. the resources given such a name. At this time the URN-WG is considering
  64. one particular resolution mechanism, the NAPTR proposal. That proposal
  65. does not get the client software all the way from the URN to the resource.
  66. Instead, it gets the client from a URN to a "resolver", which is a system
  67. that can then tell the client where the resource is. The NAPTR draft
  68. defines a "resolution protocol" to be the protocol used to speak to a
  69. resolver in order to obtain the resource, its location(s), or other
  70. information about the resource. The NAPTR proposal allows different
  71. resolution protocols to be used for commuicating with resolvers.
  72.  
  73. This draft establishes conventions for encoding URN resolution requests
  74. and responses in HTTP 1.0 (and 1.1) requests and responses. The primary
  75. goal of this draft is to define a convention that is simple to implement
  76. and will allow existing HTTP servers to easily add support for URN
  77. resolution. We expect that the resolution databases that arise will be
  78. useful when more sophisticated resolution protocols are developed later.
  79.  
  80.  
  81. 1.0  Introduction:
  82. ==================
  83.  
  84. The NAPTR draft[1] describes a way of using DNS to locate resolvers for
  85. URIs.  That draft provides places to specify the "resolution protocol"
  86. spoken by the resolver, as well as the "resolution services" it offers.
  87. As of this writing, the "resolution protocols" allowed by the NAPTR draft
  88. are HTTP, RCDS, HDL, and RWHOIS. (That list is expected to grow over time).
  89. The NAPTR draft also lists a variety of resolution services, such
  90. as N2L (given a URN, return a URL); N2R (Given a URN, return the named
  91. resource), etc. This draft specifies the conventions to follow to
  92. encode resolution service requests in the HTTP protocol, allowing
  93. widely available HTTP daemons to serve as URN resolvers.
  94.  
  95. The reader is assumed to be familiar with the HTTP/1.0 [2] and 1.1 [3]
  96. specifications.
  97.  
  98.  
  99. 2.0 General Approach:
  100. =====================
  101.  
  102. The general approach used to encode resolution service requests in HTTP
  103. is quite simple: 
  104.  
  105.     GET /uri-res/<service>/<uri>  HTTP/1.0
  106.  
  107. For example, if we have the URN "cid:foo@huh.com" and want a URL,
  108. we would send the request:
  109.  
  110.     GET /uri-res/N2L/cid:foo@huh.com HTTP/1.0
  111.  
  112. Because of the character set limitations on URIs, we might wish to
  113. encode the '@' character as its hex equivalent, thus the request would be
  114.  
  115.     GET /uri-res/N2L/cid:foo%40huh.com HTTP/1.0
  116.  
  117. The request could also be encoded as an HTTP 1.1 request. This would look
  118. like:
  119.  
  120.     GET /uri-res/N2L/cid:foo%40huh.com HTTP/1.1
  121.     Host: <whatever host we are sending the request to>
  122.  
  123. Handling these requests on the server side is easy to implement in a
  124. number of ways. The N2L request could be handled by a CGI script that
  125. took the incoming URN, looked it up in a database, and returned the URL
  126. as an HTTP redirect. Service requests like N2R or N2C could be set up
  127. so that the daemon answered the request by returning files out of N2R/
  128. and N2C/ directories, or they could be handled by a script.
  129.  
  130. One caveat should be kept in mind. The "urn:" prefix is still the
  131. subject of controversy, so some URN documents advocate treating it
  132. as optional. HTTP resolvers MUST return identical results for URIs
  133. that do and do not contain the "urn:" prefix. For example, the two
  134. request below must return identical results:
  135.     GET /uri-res/N2L/cid:foo%40huh.com HTTP/1.0
  136.     GET /uri-res/N2L/urn:cid:foo%40huh.com HTTP/1.0
  137.  
  138. Responses from the HTTP server follow standard HTTP practice. Status
  139. codes, such as 200 (OK) or 404 (Not Found) shall be returned.
  140. The normal rules for determining cachability, negotiating formats, etc.
  141. apply.
  142.  
  143.  
  144. 3.0 Service-specific details:
  145. =============================
  146.  
  147. This section goes through the various resolution services established
  148. in the URN Framework draft [4] and states how to encode each of them,
  149. how the results should be returned, and any special status codes that
  150. are likely to arise.
  151.  
  152. Unless stated otherwise, the HTTP requests are formed according to
  153. the simple convention above, either for HTTP/1.0 or HTTP/1.1. The response
  154. is assumed to be an entity with normal headers and body unless stated
  155. otherwise. (N2L is the only request that does not return a body).
  156.  
  157.  
  158. 3.1  N2L (URN to URL):
  159. ----------------------
  160.  
  161. The request is encoded as above. The URL MUST be returned in a Location:
  162. header for the convienience of the most common case of wanting the resource.
  163. A 30X status line SHOULD be returned. HTTP/1.1 clients should be sent the
  164. 303 status code. HTTP/1.0 clients should be sent the 302 (Moved temporarily)
  165. status code unless the resolver has particular resons for using 301
  166. (moved permanently) or 304 (not modified) codes.
  167.  
  168.  
  169. 3.2  N2Ls (URN to URLs):
  170. ------------------------
  171.  
  172. The request is encoded as above. The result is a list of 0 or
  173. more URLs. The Internet Media Type (aka ContentType) of the result
  174. may be negotiated using standard HTTP mechanisms if desired. At a
  175. minimum the resolver should support the text/uri-list media type.
  176. (See Appendix A for the definition of this media type). That media
  177. type is suitable for machine-processing of the list of URLs. Resolvers
  178. may also return the results as text/html, text/plain, or any other
  179. media type they deem suitable.
  180.  
  181. No matter what the particular media type, the result MUST be a list
  182. of the URLs which may be used to obtain an instance of the resource
  183. identified by the URN. All URIs shall be encoded according to the
  184. URI specification [5].
  185.  
  186. If the client has requested the result be returned as text/html or
  187. application/html, the result should be encoded as:
  188. <UL>
  189. <LI><A HREF="...url 1...">...url 1...</A>
  190. <LI><A HREF="...url 2...">...url 2...</A>
  191.  etc.
  192. </UL>
  193. where the strings ...url n... are replaced by the n'th URL in the list.
  194.  
  195.  
  196. 3.3  N2R (URN to Resource):
  197. ---------------------------
  198.  
  199. The request is encoded as above. The resource is returned using
  200. standard HTTP mechanisms. The request may be modified using the
  201. Accept: header as in normal HTTP to specify that the result
  202. be given in a preferred Internet Media Types.
  203.  
  204.  
  205. 3.4  N2Rs (URN to Resources):
  206. -----------------------------
  207.  
  208. This resolution service returns multiple instances of a resource,
  209. for example, GIF and JPEG versions of an image. The judgment about
  210. the resources being "the same" resides with the naming authority that
  211. issued the URN.
  212.  
  213. The request is encoded as above. The result shall be a MIME
  214. multipart/alternative message with the alternative versions of the
  215. resource in seperate body parts. If there is only one version of
  216. the resource identified by the URN, it MAY be returned without the
  217. multipart/alternative wrapper. Resolver software SHOULD look at the
  218. Accept: header, if any, and only return versions of the resource
  219. that are acceptable according to that header. 
  220.  
  221.  
  222. 3.5  N2C (URN to URC):
  223. ----------------------
  224.  
  225. URCs (Uniform Resource Characteristics) are descriptions of other
  226. resources. This request allows us to obtain a description of the
  227. resource identified by a URN, as opposed to the resource itself.
  228. The description might be a bibliographic citation, a digital signature,
  229. a revision history, etc. This draft does not specify the content of
  230. any response to a URC request. That content is expected to vary from
  231. one resolver to another.
  232.  
  233. The format of any response to a N2C request MUST be communicated using the
  234. ContentType header, as is standard HTTP practice. The Accept: header
  235. SHOULD be honored.
  236.  
  237.  
  238. 3.6  N2Ns (URN to URNs):
  239. ------------------------
  240.  
  241. While URNs are supposed to identify one and only one resource, that
  242. does not mean that a resource may have one and only one URN. For
  243. example, consider a resource that has something like
  244. "current-weather-map" for one URN and "weather-map-for-datetime-x" for
  245. another URN. The N2Ns service request lets us obtain lists of URNs that
  246. are believed equivalent at the time of the request. As the weathermap
  247. example shows, some of the equivalances will be transitory, so the
  248. standard HTTP mechanisms for communicating cachability MUST be honored.
  249.  
  250. The request is encoded as above. The result is a list of all the
  251. URNs, known to the resolver, which identify the same resource as the
  252. input URN. The result shall be encoded as for the N2Ls request
  253. above (text/uri-list unless specified otherwise by an Accept: header).
  254.  
  255. 3.7  L2Ns (URL to URNs):
  256. ----------------------
  257.  
  258. The request is encoded as above. The response is a list of any URNs
  259. known to be assigned to the resource at the given URL. The result
  260. shall be encoded as for the N2Ls and N2Ns requests.
  261.  
  262.  
  263. 3.8  L2Ls (URL to URLs):
  264. ------------------------
  265.  
  266. The request is encoded as described above. The result is a list of
  267. all the URLs that the resolver knows are associated with the resource
  268. located by the given URL. This is encoded as for the N2Ls, N2Ns, and L2Ns
  269. requests.
  270.  
  271.  
  272. 3.9  L2C (URL to URC):
  273. ----------------------
  274.  
  275. The request is encoded as above, the response is the same as for the
  276. N2C request.
  277.  
  278.  
  279. Implementation Notes:
  280. =====================
  281.  
  282. This section gives an example of how to configure a web server to
  283. respond to the N2L resolution request. It is not intended to specify
  284. standard behavior, it is provided here merely as a courtesy for
  285. implementors.
  286.  
  287. First, we assume the presence of a CGI script, n2l.pl, that processes
  288. the provided URN, converting it into a canonical format. It would remove
  289. any "urn:" prefix,  decode any %encoded special characters, normalize
  290. case-insensitive parts of the URN to lower case, etc. It would then use
  291. the normalized URN as the key for a search in a database, which we assume
  292. returns the URL as a string. A sample of our implementation of that script
  293. is provided as Appendix B. We will further assume that the n2l.pl script
  294. is in the cgi-bin directory of the web server.
  295.  
  296. The easiest way to invoke the n2l.pl script in response to N2L requests
  297. is to set up a Redirect directive in the srm.conf file. (This works for
  298. servers based on the original NCSA HTTP daemon, such as Apache.) The
  299. relevant Redirect directives might look like:
  300.  
  301. Redirect /uri-res/N2L http://urn.acl.lanl.gov/cgi-bin/n2l.pl
  302. Redirect /uri-res/L2N http://urn.acl.lanl.gov/cgi-bin/l2n.pl
  303.  
  304.  
  305.  
  306. Appendix A: The text/uri-list Internet Media Type
  307. =================================================
  308. [This appendix will be augmented or replaced by the registration
  309. of the text/uri-list IMT once that registration has been performed].
  310.  
  311. Several of the resolution service requests, such as N2Ls, N2Ns, L2Ns,
  312. L2Ls, result in a list of URIs being returned to the client. The
  313. text/uri-list Internet Media Type is defined to provide a simple format
  314. for the automatic processing of such lists of URIs.
  315.  
  316. The format of text/uri-list resources is:
  317. 1) Any lines beginning with the '#' character are comment lines
  318.    and are ignored during processing. (Note that '#' is a character
  319.    that may appear in URIs, so it only denotes a comment when it is the
  320.    first character on a line).
  321. 2) The remaining non-comment lines MUST be URIs (URNs or URLs), encoded
  322.    according to the URI specification RFC[5]. Each URI shall appear on
  323.    one and only one line.
  324. 3) As for all text/* formats, lines are terminated with a CR LF pair.
  325.  
  326. In applications where one URI has been mapped to a list of URIs, such
  327. as in response to the N2Ls request, the first line of the text/uri-list
  328. response SHOULD be a comment giving the original URI. 
  329.  
  330. An example of such a result for the N2L request is shown below in figure 1.
  331.  
  332.      # urn:cid:foo@huh.org
  333.      http://www.huh.org/cid/foo.html
  334.      http://www.huh.org/cid/foo.pdf
  335.      ftp://ftp.foo.org/cid/foo.txt
  336.  
  337.                Figure 1: Example of the text/uri-list format
  338.  
  339.  
  340. Appendix B:  n2l.pl script
  341. ==========================
  342.  
  343. This is a simple perl script for the N2L resolution service. It
  344. assumes the presence of a DBM database to store the URN to URL
  345. mappings.
  346.  
  347.  
  348.     #!/bin/perl
  349.     # N2L  - performs urn to url  resolution 
  350.  
  351.     $n2l_File = "...filename for DBM database...";
  352.  
  353.  
  354.     $urn = $ENV{'PATH_INFO'} ;
  355.     if(length($urn)<3)
  356.     {
  357.         $error=1;
  358.     }
  359.  
  360.     if(!$error)
  361.     {
  362.         $urn =~s/^(\/)(urn:)?(.*)/$3/i;
  363.         # Additional canonicalization should be performed here
  364.  
  365.         dbmopen(%lu,$n2l_File,0444);
  366.         if($lu{$urn})
  367.         {
  368.         $url=$lu{$urn};
  369.         print STDOUT "Location: $url\n\n";
  370.         }else{
  371.         $error=2;
  372.         }
  373.         dbmclose(%lu);
  374.     }
  375.  
  376.     if($error)
  377.     {
  378.         print "Content-Type: text/html \n\n";
  379.         print "<html>\n";
  380.         print "<head><title>URN Resolution: N2L</title></head>\n";
  381.         print "<BODY>\n";
  382.         print "<h1>URN to URL resolution failed for the URN:</h1>\n";
  383.         print "<hr><h3>$urn</h3>\n";
  384.         print "</body>\n";
  385.         print "</html>\n";
  386.     }
  387.  
  388.     exit;
  389.  
  390.  
  391. References:
  392. ===========
  393.  
  394. [1] Ron Daniel and Michael Mealling, "Resolution of Uniform Resource
  395.     Identifiers using the Domain Name System", draft-ietf-urn-naptr-00.txt,
  396.     October, 1996.
  397.  
  398. [2] T. Berners-Lee, R. Fielding, H. Frystyk, "Hypertext Transfer
  399.     Protocol -- HTTP/1.0", RFC 1945, May, 1996.
  400.  
  401. [3] HTTP 1.1 draft
  402.  
  403. [4] URN Framework draft
  404.  
  405. [5] RFC 1630
  406.  
  407.  
  408. Security Considerations
  409. =======================
  410.   Communications with a resolver may be of a sensitive nature. Some
  411.   resolvers will hold information that should only be released to
  412.   authorized users. The results from resolvers may be the target of
  413.   spoofing, especially once electronic commerce transactions are common
  414.   and ther is money to be made by directing users to pirate repositories
  415.   rather than repositories which pay royalties to rightsholders. Resolution
  416.   requests may be of interest to traffic analysts. The requests may also
  417.   be subject to spoofing.
  418.  
  419.   The requests and responses in this draft are amenable to encoding,
  420.   signing, and authentication in the manner of any other HTTP traffic.
  421.  
  422.  
  423. Author Contact Information:
  424. ===========================
  425.  
  426. Ron Daniel
  427. Los Alamos National Laboratory
  428. MS B287
  429. Los Alamos, NM, USA, 87545
  430. voice:  +1 505 665 0597
  431. fax:    +1 505 665 4939
  432. email:  rdaniel@lanl.gov
  433.  
  434.  
  435.     This draft expires 15 May, 1997.
  436. Ron Daniel Jr.                   email: rdaniel@acl.lanl.gov
  437. Advanced Computing Lab           voice: (505) 665-0597
  438. MS B-287  TA-3  Bldg. 2011         fax: (505) 665-4939
  439. Los Alamos National Lab           http://www.acl.lanl.gov/~rdaniel/
  440. Los Alamos, NM,  87545    obscure_term: "hypernym"